#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll rr() {
    ll s = 0, w = false, c = getchar();
    for (; !isdigit(c); c = getchar())
        w = w || c == '-';
    for (; isdigit(c); c = getchar())
        s = s * 10 + c - '0';
    return w ? -s : s;
}

// END OF HEADER

void dfs(int n, char a, char b, char c) {
    if (n == 1) {
        printf("%c-->%c\n", a, c);
    } else {
        dfs(n - 1, a, c, b);
        printf("%c-->%c\n", a, c);
        dfs(n - 1, b, a, c);
    }
}

int main() {
    int n = rr();
    dfs(n, 'A', 'B', 'C');
    printf("%d\n", (1 << n) - 1);
    return 0;
}